--使用方法：直接粘贴到模组环境

local no_planar_damagge = true
AddComponentPostInit("riftspawner", function(RiftSpawner, owner)
    if TheWorld:HasTag("cave") then
        local _EnableShadowRifts = RiftSpawner.EnableShadowRifts
        function RiftSpawner:EnableShadowRifts(src, ...)
            no_planar_damagge = false
            return _EnableShadowRifts(self, src, ...)
        end
    else
        local _EnableLunarRifts = RiftSpawner.EnableLunarRifts
        function RiftSpawner:EnableLunarRifts(src, ...)
            no_planar_damagge = false
            return _EnableLunarRifts(self, src, ...)
        end
    end
end)

local Combat = require("components/combat")
local _GetAttacked = Combat.GetAttacked
function Combat:GetAttacked(attacker, damage, weapon, stimuli, spdamage, ...)
    if spdamage and spdamage.planar and no_planar_damagge then
        spdamage.planar = 0
    end
    return _GetAttacked(self, attacker, damage, weapon, stimuli, spdamage, ...)
end